package fr.vahren.sriksal.controller.impl;

import com.opensymphony.xwork2.ActionSupport;

import fr.vahren.sriksal.business.ITestBusiness;
import fr.vahren.sriksal.controller.IWelcomeController;

public class WelcomeController extends ActionSupport implements IWelcomeController{

	/**
	 * 
	 */
	private static final long serialVersionUID = 5266230597418923384L;
	
	private ITestBusiness testBusiness;
	
	/* (non-Javadoc)
	 * @see fr.vahren.sriksal.controller.impl.ITestController#setTestBusiness(fr.vahren.sriksal.business.ITestBusiness)
	 */
	@Override
	public void setTestBusiness(ITestBusiness testBusiness) {
		this.testBusiness = testBusiness;
	}

	/**
	 * Message attribute.
	 */
	private String message;
	
	/* (non-Javadoc)
	 * @see fr.vahren.sriksal.controller.impl.ITestController#execute()
	 */
	@Override
	public String execute() throws Exception {
		// Call to the business.
		setMessage(testBusiness.getMessage());
		return SUCCESS;
	}

	/* (non-Javadoc)
	 * @see fr.vahren.sriksal.controller.impl.ITestController#getMessage()
	 */
	@Override
	public String getMessage() {
		return message;
	}

	/* (non-Javadoc)
	 * @see fr.vahren.sriksal.controller.impl.ITestController#setMessage(java.lang.String)
	 */
	@Override
	public void setMessage(String message) {
		this.message = message;
	}
	
	
	
}
